package com.cf.r1041;

import java.io.*;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

public class a {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StreamTokenizer in = new StreamTokenizer(br);
        PrintWriter out = new PrintWriter(System.out);
        in.nextToken();
        int t = (int) in.nval;
        while (t-- > 0) {
            in.nextToken(); int n = (int) in.nval;
            Set<Integer> set = new HashSet<>();
            for (int i = 0; i < n; i++) {
                in.nextToken(); int x = (int) in.nval;
                if (x != -1)
                    set.add(x);
            }
            if (set.isEmpty()) {
                out.println("yes");
            } else if (set.size() == 1) {
                int c = set.iterator().next();
                out.println(c >= 1 ? "yes" : "no");
            } else {
                out.println("no");
            }
        }
        out.flush();
        out.close();
        br.close();
    }
}